package it.etoken.component.news.dao.mapper;

import it.etoken.base.model.news.entity.NewsUserLog;
import it.etoken.base.model.news.entity.NewsUserLogExample;
import it.etoken.component.news.dao.provider.NewsUserLogSqlProvider;

import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.DeleteProvider;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.InsertProvider;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.SelectProvider;
import org.apache.ibatis.annotations.Update;
import org.apache.ibatis.annotations.UpdateProvider;
import org.apache.ibatis.type.JdbcType;

@Mapper
public interface NewsUserLogMapper {
    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table news_user_log
     *
     * @mbg.generated Tue May 22 17:40:56 CST 2018
     */
    @SelectProvider(type=NewsUserLogSqlProvider.class, method="countByExample")
    long countByExample(NewsUserLogExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table news_user_log
     *
     * @mbg.generated Tue May 22 17:40:56 CST 2018
     */
    @DeleteProvider(type=NewsUserLogSqlProvider.class, method="deleteByExample")
    int deleteByExample(NewsUserLogExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table news_user_log
     *
     * @mbg.generated Tue May 22 17:40:56 CST 2018
     */
    @Delete({
        "delete from news_user_log",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int deleteByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table news_user_log
     *
     * @mbg.generated Tue May 22 17:40:56 CST 2018
     */
    @Insert({
        "insert into news_user_log (id, nid, uid, ",
        "optype, createdate)",
        "values (#{id,jdbcType=BIGINT}, #{nid,jdbcType=BIGINT}, #{uid,jdbcType=BIGINT}, ",
        "#{optype,jdbcType=VARCHAR}, #{createdate,jdbcType=TIMESTAMP})"
    })
    int insert(NewsUserLog record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table news_user_log
     *
     * @mbg.generated Tue May 22 17:40:56 CST 2018
     */
    @InsertProvider(type=NewsUserLogSqlProvider.class, method="insertSelective")
    int insertSelective(NewsUserLog record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table news_user_log
     *
     * @mbg.generated Tue May 22 17:40:56 CST 2018
     */
    @SelectProvider(type=NewsUserLogSqlProvider.class, method="selectByExample")
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="nid", property="nid", jdbcType=JdbcType.BIGINT),
        @Result(column="uid", property="uid", jdbcType=JdbcType.BIGINT),
        @Result(column="optype", property="optype", jdbcType=JdbcType.VARCHAR),
        @Result(column="createdate", property="createdate", jdbcType=JdbcType.TIMESTAMP)
    })
    List<NewsUserLog> selectByExample(NewsUserLogExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table news_user_log
     *
     * @mbg.generated Tue May 22 17:40:56 CST 2018
     */
    @Select({
        "select",
        "id, nid, uid, optype, createdate",
        "from news_user_log",
        "where id = #{id,jdbcType=BIGINT}"
    })
    @Results({
        @Result(column="id", property="id", jdbcType=JdbcType.BIGINT, id=true),
        @Result(column="nid", property="nid", jdbcType=JdbcType.BIGINT),
        @Result(column="uid", property="uid", jdbcType=JdbcType.BIGINT),
        @Result(column="optype", property="optype", jdbcType=JdbcType.VARCHAR),
        @Result(column="createdate", property="createdate", jdbcType=JdbcType.TIMESTAMP)
    })
    NewsUserLog selectByPrimaryKey(Long id);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table news_user_log
     *
     * @mbg.generated Tue May 22 17:40:56 CST 2018
     */
    @UpdateProvider(type=NewsUserLogSqlProvider.class, method="updateByExampleSelective")
    int updateByExampleSelective(@Param("record") NewsUserLog record, @Param("example") NewsUserLogExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table news_user_log
     *
     * @mbg.generated Tue May 22 17:40:56 CST 2018
     */
    @UpdateProvider(type=NewsUserLogSqlProvider.class, method="updateByExample")
    int updateByExample(@Param("record") NewsUserLog record, @Param("example") NewsUserLogExample example);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table news_user_log
     *
     * @mbg.generated Tue May 22 17:40:56 CST 2018
     */
    @UpdateProvider(type=NewsUserLogSqlProvider.class, method="updateByPrimaryKeySelective")
    int updateByPrimaryKeySelective(NewsUserLog record);

    /**
     * This method was generated by MyBatis Generator.
     * This method corresponds to the database table news_user_log
     *
     * @mbg.generated Tue May 22 17:40:56 CST 2018
     */
    @Update({
        "update news_user_log",
        "set nid = #{nid,jdbcType=BIGINT},",
          "uid = #{uid,jdbcType=BIGINT},",
          "optype = #{optype,jdbcType=VARCHAR},",
          "createdate = #{createdate,jdbcType=TIMESTAMP}",
        "where id = #{id,jdbcType=BIGINT}"
    })
    int updateByPrimaryKey(NewsUserLog record);
}